<template>
  <div>

  </div>
</template>

<script setup lang="ts">
const button= ()=> {
    // 此处就没有动态去获取db.json中fruits的最大id，直接带入10
    for (var i = 0; i <= 10; i++) {
        delFun(i)
    }
}

function delFun(id) {
   http({
        type: 'delete',
        url: 'http://localhost:3004/fruits/' + id,
        data: '',
        success: function (data) {
            console.log("del success", data)
        },
        error: function () {
            console.log("del error")
        }
    })
  }
</script>

<style scoped lang="scss">

</style>
